package com.example.springbootquartz.service;

import com.example.springbootquartz.entity.ScheduleJob;

import org.quartz.SchedulerException;

import com.baomidou.mybatisplus.extension.service.IService;


public interface IQuartzJobService extends IService<ScheduleJob> {


    /**
     * 保存定时任务
     * @param quartzJob
     * @return boolean
     */
	boolean saveScheduleJob(ScheduleJob quartzJob);

    /**
     * 编辑定时任务
     * @param quartzJob
     * @return boolean
     * @throws SchedulerException
     */
	boolean editScheduleJob(ScheduleJob quartzJob) throws SchedulerException;

    /**
     * 删除定时任务
     * @param quartzJob
     * @return boolean
     */
	boolean deleteStopJob(ScheduleJob quartzJob);

    /**
     * 恢复定时任务
     * @param quartzJob
     * @return
     */
	boolean resumeJob(ScheduleJob quartzJob);

	/**
	 * 执行定时任务
	 * @param quartzJob
     * @throws Exception
	 */
	void execute(ScheduleJob quartzJob) throws Exception;

	/**
	 * 暂停任务
	 * @param quartzJob
	 * @throws SchedulerException
	 */
	void pause(ScheduleJob quartzJob);
}
